Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update dependency immer to v10 #132

Merged
merged 3 commits into from
Feb 20, 2024
Merged

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jul 3, 2023

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
immer ^9.0.21 -> ^10.0.3 age adoption passing confidence

Release Notes

immerjs/immer (immer)

v10.0.3

Compare Source

Bug Fixes

v10.0.2

Compare Source

Bug Fixes

v10.0.1

Compare Source

Bug Fixes

v10.0.0

Compare Source

Release notes

  • [breaking change] Immer 10 only supports modern browsers, that have support for Proxy, Reflect, Symbol and Map and Set.
  • [breaking change] There is no longer a UMD build exposed (thanks Mark Erikson for modernizing the build setup in #​1032!
  • [breaking change] getters and setters are ignored by default on plain object, as this is a very uncommon case and provides a significant performance boost (ca 33%, but depends a lot on the scenario). Fixes #​867, #​1012. Thanks hrsh7th for implementing it in #​941!
  • [breaking change] Promise based reducers are no longer supported. Conceptually it is an anti pattern to hold on to drafts over time. If needed the old behavior can still be achieved by leveraging createDraft and finishDraft.
  • [breaking change] ES5 mode (for legacy browsers) has been dropped. If your project relies on enableES5(), you SHOULD NOT upgrade Immer. enableES5 has been removed.
  • [breaking change] produce is no longer exposed as the default export. This improves eco system compatibility, and makes sure that there is only one correct way of doing things
  • [breaking change] enableAllPlugins has been removed, use enablePatches(); enableMapSet() instead
  • [breaking change] shortening the length of a JSON array now results in delete patches, rather than a mutation of the length property, in accordance with JSON spec. Thanks kshramt for implementing this in #​964!
  • Immer is now an ESM package that can be directly imported into the browser. CJS should still work, UMD support has been removed.

Overall, there is a rough performance increase of 33% for Immer (and in some cases significantly higher), and the (non gzipped) bundle size has reduced from 16 to 11.5 KB, while the the minimal gzipped import of just produce has remained roughly the same at 3.3 KB.

For more details, see #​1015

Migration steps

  1. If you have any enableES5() call, don't migrate
  2. When using getters/ setters icmw plain objects, call useStrictShallowCopy(true) at startup
  3. Replace all default imports: Replace import produce from "immer" with import {produce} from "immer"
  4. Replace all calls to enableAllPlugins() with enablePatches(); enableMapSet(); to be more specific and smoothen future migrations.
  5. If any producer returned a Promise, refactor it to leverage createDraft instead. Roughly:
const newState = await produce(oldState, recipe)

// becomes
const draft  = createDraft(oldState)
await recipe(draft)
const newState = finishDraft(draft)

Configuration

📅 Schedule: Branch creation - "before 4am on Monday" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot added the dependencies label Jul 3, 2023
@renovate renovate bot force-pushed the renovate/immer-10.x branch 2 times, most recently from 5426684 to ff3cacc Compare July 10, 2023 04:16
@renovate renovate bot force-pushed the renovate/immer-10.x branch 2 times, most recently from 63a4c21 to acd6936 Compare July 17, 2023 04:48
@renovate renovate bot force-pushed the renovate/immer-10.x branch 4 times, most recently from 7200959 to edc43f1 Compare July 31, 2023 03:34
@renovate renovate bot force-pushed the renovate/immer-10.x branch 3 times, most recently from af0ab2b to f59a51b Compare August 7, 2023 04:31
@renovate renovate bot force-pushed the renovate/immer-10.x branch 3 times, most recently from 1f6e971 to 0aacefb Compare August 14, 2023 07:52
@renovate renovate bot force-pushed the renovate/immer-10.x branch 3 times, most recently from d19f949 to b707a41 Compare August 21, 2023 06:22
@renovate renovate bot force-pushed the renovate/immer-10.x branch 3 times, most recently from 1f0e061 to c147c5e Compare August 28, 2023 08:36
@renovate renovate bot force-pushed the renovate/immer-10.x branch 3 times, most recently from f44c276 to 3e31d75 Compare September 18, 2023 03:13
@renovate renovate bot force-pushed the renovate/immer-10.x branch 3 times, most recently from b540655 to 2a23e54 Compare October 2, 2023 03:56
@renovate renovate bot force-pushed the renovate/immer-10.x branch 2 times, most recently from d5f5693 to 8eedf70 Compare October 2, 2023 11:12
@renovate renovate bot force-pushed the renovate/immer-10.x branch 2 times, most recently from ca7eae6 to 3b59366 Compare January 1, 2024 07:03
@renovate renovate bot force-pushed the renovate/immer-10.x branch 2 times, most recently from a0cfa02 to 73134da Compare January 15, 2024 06:46
@renovate renovate bot force-pushed the renovate/immer-10.x branch 3 times, most recently from 07c753d to 24f0294 Compare January 22, 2024 14:03
@renovate renovate bot force-pushed the renovate/immer-10.x branch 3 times, most recently from 5c24530 to ac70cb0 Compare February 5, 2024 07:27
@renovate renovate bot force-pushed the renovate/immer-10.x branch 11 times, most recently from 9d25fce to 49ecdcb Compare February 12, 2024 06:14
@renovate renovate bot force-pushed the renovate/immer-10.x branch 2 times, most recently from 324db10 to 7fd32eb Compare February 19, 2024 06:57
Copy link
Contributor Author

renovate bot commented Feb 20, 2024

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

Warning: custom changes will be lost.

@hannoeru hannoeru merged commit 973e94e into main Feb 20, 2024
8 checks passed
@hannoeru hannoeru deleted the renovate/immer-10.x branch February 20, 2024 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant